<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .box {
        width: 100px;
        height: 100px;
        background: red;
        position: absolute;
        left: 0px;
        top: 0px;
        transition:all 1s;
        border-radius: 50%;
        
    }
</style>
</head>
<body>
    <div class="box"></div>
    <script>
        var box = document.querySelector('.box')
        function fn1(cb){
            setTimeout(()=>{
                box.style.left = 200 +'px'
                cb()
            },1000)
        }
        function fn2(cb){
            setTimeout(()=>{
                box.style.top = 200 +'px'
                cb()
            },1000)
        }
        function fn3(cb){
            setTimeout(()=>{
                box.style.left = 0
                cb()
            },1000)
        }
        function fn4(cb){
            setTimeout(()=>{
                box.style.top = 0
                cb()
            },1000)
        }
        fn1(function(){
                fn2(function(){
                    fn3(function(){
                        fn4(function(){})
                    })
                })
            })
        setInterval(()=>{
            fn1(function(){
                fn2(function(){
                    fn3(function(){
                        fn4(function(){})
                    })
                })
            })
        },4000)
    </script>
</body>
</html>